package com.zsrt.java.day20161226.zzm.demo03;

import java.util.Scanner;

import org.junit.Test;

public class SwitchTest {
	
	public static void main(String[] args) {
		Scanner sc   = new Scanner(System.in);
		while(true){
			System.out.println("请输入您的成绩:");
		    String grade = sc.next();
		    System.out.println(switchText(grade));
		    System.out.println("继续请按c,退出请按y");
		    String temp = sc.next();
		    if(temp.equals("y")){
		    	System.out.println("程序已经退出");
		    	break;
		    }
		}
	    sc.close();
	}
	public static String switchText(String grade){
		String temp = "";
	    switch (grade) {
		case "A":temp = "优秀";   break;
		case "B":temp = "良好";   break;
		case "C":temp = "差 ";    break;
		default: temp = "有问题 "; break;
		}
	    return temp;
	}
}
